import subprocess

def espeak_speak(text, lang='zh', speed=160, pitch=50):
    cmd = [
        'espeak',
        '-v', lang,    # 语言
        '-s', str(speed),  # 语速
        '-p', str(pitch),  # 音调 (0-99)
        '-a', '200',   # 振幅 (0-200)
        text
    ]
    subprocess.run(cmd)

# 使用
espeak_speak("直接调用eSpeak测试", lang='zh', speed=150, pitch=60)